<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<?php  @session_start();
include '../Paging/paging.php';
include '../Home/DefineVar.php';
include '../DataBase/ConnectDB.php';
 mysql_select_db(MYSQL_DATABASE,$link);
 //Phan trang va hien thi
$p = $_GET['p'];// currentPage
$rows = RECORD_IN_PAGE; // số record trên mỗi trang
$div = PAGE_ON_DEV; // số trang trên 1 phân đoạn

$result =mysql_query("SELECT COUNT(*) AS total FROM ".MYSQL_TABLE_ROOMINFOR,$link);
if(mysql_num_rows($result)!=0){
$row=mysql_fetch_array($result);
}
$total=$row[0];

if($p==0)$p=1;
//else $p=$_GET['p'];
$start = ($p-1)*$rows;
$result=mysql_query("SELECT * FROM ".MYSQL_TABLE_ROOMINFOR." LIMIT ".$start.", ".$rows,$link);

print("<h1> 会議室情報</h1>");
print("<table border ='2' bordercolor = 'FFFFFF' cellspacing ='1' style='font-size: 18px'><tbody align='center' size='5'><tr><td >会議室名</td><td>席数</td><td>使用料</td><td>予約手数料</td><td>キャンセル料</td><td>罰金</td></tr>");
if(mysql_num_rows($result)!=0){
while($row=mysql_fetch_array($result)){
print("<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]VND/30分</td><td>$row[5]VND/30分</td><td>$row[4]VND</td><td>$row[3]VND/30分</td></tr>");
}
print("</tbody></table>");
}
else print(SEARCH_NOT_DATA_MESS);
mysql_close($link);
print(paging($total,$p,$div,$rows));
?>
<?= paging($total,$p,$div,$rows)?>
</body>
</html>